﻿<script type="text/javascript">

    function closePopup() {
        if (!$('.popup-window').hasClass('hidden')) {
            $('.popup-window').addClass('hidden');
        }
        $('#layout-back').remove();
    }

    function openPopup() {
        if ($('.popup-window').hasClass('hidden')) {
            $('.popup-window').removeClass('hidden');
            $('body').append('<div id="layout-back"></div>');
        } else {
            $('.popup-window').addClass('hidden');
            $('#layout-back').remove();
        }
    }
    $('#header #top-nav, #header #logo, #layout-back').live("click", function () {
        closePopup();
    });
</script>

<a href="javascript:;" onclick="openPopup();">
    <span style="display: inline-block; text-overflow: ellipsis;font-size: 1.5em;" class="name">@ViewBag.CurrentUserFullName</span>
    <img src="@Url.Content("~/" + ViewBag.PicturePath)" height="50" />
</a>
<div class="popup-window hidden">
    <div style="overflow: hidden;">
        <div style="float: left;margin-right: 10px;">
            <img src="@Url.Content("~/" + ViewBag.PicturePath)" height="100" />
        </div>
        <div>
            <span style="font-size: 1.2em;display: block;font-weight: bold;">
                @ViewBag.CurrentUserFullName
            </span>
            <span style="color: #aaa;display: block;">
                @ViewBag.CurrentUserPosition
            </span>
            <span style="display: block;height: 30px; margin: 10px 0; background: whitesmoke;">
                @ViewBag.CurrentUserComment
            </span>
            <a href="@Url.Action("Index","Profile")" class="btn btn-primary">
                Посмотреть профиль
            </a>
        </div>
    </div>
    <div style="width: 100%;overflow: hidden; margin-top: 10px;padding-top: 10px;border-top: 1px solid #bebebe;">
        <a href="@Url.Action("Edit", "Profile")" class="btn" style="float: left">
            Редактировать
        </a>
        <a href="@Url.Action("LogOff","Account")" class="btn" style="float: right">
            Выйти
        </a>
    </div>

</div>